import { FC } from 'react';
import { QuestionInfoPropsType, QuestionInfoDefaultProps } from './interface';
import { Typography } from 'antd';
const { Title, Paragraph } = Typography;
const Component: FC<QuestionInfoPropsType> = (props: QuestionInfoPropsType) => {
  const { title = '', desc = '' } = { ...QuestionInfoDefaultProps, ...props };
  const descList = desc.split('\n');
  return (
    <div style={{ textAlign: 'center' }}>
      <Title style={{ fontSize: '24px' }}>{title}</Title>
      <Paragraph>
        {descList.map((desc, index) => {
          return (
            <span key={index}>
              {index > 0 && <br />}
              {desc}
            </span>
          );
        })}
      </Paragraph>
    </div>
  );
};
export default Component;
